home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / dejagnu.lha / dejagnu-1.0.1 / tcl / tests / join.test < prev    next >
Text File  |  1992-11-06  |  2KB  |  42 lines

  1. # Commands covered:  join
  2. #
  3. # This file contains a collection of tests for one or more of the Tcl
  4. # built-in commands.  Sourcing this file into Tcl runs the tests and
  5. # generates output for errors.  No output means no errors were found.
  6. #
  7. # Copyright 1991 Regents of the University of California
  8. # Permission to use, copy, modify, and distribute this
  9. # software and its documentation for any purpose and without
  10. # fee is hereby granted, provided that this copyright notice
  11. # appears in all copies.  The University of California makes no
  12. # representations about the suitability of this software for any
  13. # purpose.  It is provided "as is" without express or implied
  14. # warranty.
  15. #
  16. # $Header: /sprite/src/lib/tcl/tests/RCS/join.test,v 1.3 91/08/01 17:19:57 ouster Exp $ (Berkeley)
  17.  
  18. if {[string compare test [info procs test]] == 1} then {source defs}
  19.  
  20. test join-1.1 {basic join commands} {
  21.     join {a b c} xyz
  22. } axyzbxyzc
  23. test join-1.2 {basic join commands} {
  24.     join {a b c} {}
  25. } abc
  26. test join-1.3 {basic join commands} {
  27.     join {} xyz
  28. } {}
  29. test join-1.4 {basic join commands} {
  30.     join {12 34 56}
  31. } {12 34 56}
  32.  
  33. test join-2.1 {join errors} {
  34.     list [catch join msg] $msg $errorCode
  35. } {1 {wrong # args: should be "join list ?joinString?"} NONE}
  36. test join-2.2 {join errors} {
  37.     list [catch {join a b c} msg] $msg $errorCode
  38. } {1 {wrong # args: should be "join list ?joinString?"} NONE}
  39. test join-2.3 {join errors} {
  40.     list [catch {join "a \{ c" 111} msg] $msg $errorCode
  41. } {1 {unmatched open brace in list} NONE}
  42.